﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace Blackbird.Editors
{
    /// <summary>
    /// Interaction logic for NewModuleWindow.xaml
    /// </summary>
    public partial class NewItemWindow
    {
        public NewItemWindow()
        {
            InitializeComponent();
        }

        public string ItemName { get; set; }

        public string ItemType
        {
            get { return Title; }
            set { Title = value; }
        }

        private void OkButtonClick(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
        }

        private void CancelButtonClick(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
        }
    }

    [ValueConversion(typeof (string), typeof (string))]
    public class NameLabelConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var itemType = (string) value;
            return "New " + itemType + ":";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return string.Empty;
        }

        #endregion
    }
}